package com.cmwa.solution.business.investTrade.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cmwa.solution.base.entity.Page;
import com.cmwa.solution.base.entity.SearchParam;
import com.cmwa.solution.business.investTrade.dao.OrderManageDao;
import com.cmwa.solution.business.investTrade.entity.TradeOrderVo;
import com.cmwa.solution.business.investTrade.service.OrderManageService;

/**
 * 交易订单管理
 * @author ex-chenbq
 *
 */
@Service
public class OrderManageServiceImpl implements OrderManageService{

	@Autowired
	private OrderManageDao orderManageDao;
	
	/**
	 * 分页查询所有交易订单
	 * @param param
	 * @return
	 */
	public Page<TradeOrderVo> queryTradeOrderListPage(SearchParam param) {
		List<TradeOrderVo> items = orderManageDao.queryTradeOrderListPage(param);
		return Page.create(items, param.getStart(), param.getLimit(), param.getTotal());
	}
	
	/**
	 * 交易下单
	 * @param tradeOrderVo
	 */
	public void insertTradeOrder(TradeOrderVo tradeOrderVo) {
		orderManageDao.insertTradeOrder(tradeOrderVo);
	}
}
